﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dbPoll_Application.ViewModels.ParticipantFieldViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Participants
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript" src="../../Scripts/EditParticipant.js"></script>
    <div class="pageHeadingContainer"><h2 class="pageHeading">Participants - <%=Model.poll.name %></h2></div>
    <div id="contentContainer">
    <p>
        <%= Html.ActionLink("Polls > ", "Index", "Poll", null, new { @class = "breadcrumb" })%><%= Model.poll.name %></p>
    <div id="pageMenuContainer">
        <ul id="pageMenu">
            <li><%= Html.ActionLink("Details", "Questions", new { pollID = Model.poll.pollID }) %></li>
            <li><%= Html.ActionLink("Run", "SetSession", new { pollID = Model.poll.pollID }) %></li>
            <li><%= Html.ActionLink("Test", "Test", new { pollID = Model.poll.pollID }) %></li>
            <li><%= Html.ActionLink("Reports", "Reports", new { pollID = Model.poll.pollID }) %></li>
            <li><%= Html.ActionLink("Manage Hierarchy", "EntityHierarchy", new { pollID = Model.poll.pollID }) %></li>
        </ul>
    </div>
    <% Html.ValidationSummary(true);%>
    <%using (Html.BeginForm("Participants", "Poll", new { pollID = Model.poll.pollID, pollName = Model.poll.name  }, FormMethod.Post))
       {%>
            How do you want to track your participants?
            <input type="radio" name="type" value="Individual" <%if (Model.poll.isGroup==false){%> checked="checked"<%} %>>Individual</input>
            <input type="radio" name="type" value="Group" <%if (Model.poll.isGroup){%> checked="checked"<%} %>>Group</input>
            <input type="submit" name="Change Type" />
            <input type="hidden" name="pollid" value="<%=Model.poll.pollID %>" />
     <%} %>
     <%= Html.HiddenFor(model => model.poll.pollID) %>
     <%= Html.HiddenFor(model =>model.hasdems) %>
     <%= Html.HiddenFor(model =>model.hasCompare) %>
     Use a participant list template: <%= Html.DropDownListFor(model => model.selectedTemplateID, new SelectList(Model.templates, "templateID", "name"), "None")%>
    <%if (Model.poll.isGroup == false) Html.RenderPartial("Individual", Model);
      else Html.RenderPartial("Group", Model); %>
    <div><% using (Html.BeginForm("EditList", "Participant", new { pollID = Model.poll.pollID, pollName = Model.poll.name  }, FormMethod.Post))
       { %>
    <input type="hidden" value="<%= Model.poll.pollID %>" id="Hidden1" name="pollID"/>
    <input type="submit" value="Edit List" /> <%}%></div>
    </div>
    
</asp:Content>
